import { normalService, tmsService } from '@/api/fetch'
// import qs from 'qs'

// qiniu token
export function getToken() {
  return normalService({
    url: '/upload/getToken',
    method: 'get'
  })
}

// token = 'wQknukoe-lwcjLKEnsBz-BrL61M1BEMP0Gq_M2qP:DaUIeKt2KsDIQYx85guU1CYTGWw=:eyJzY29wZSI6Imh1aXl1bmNoZS10ZXN0IiwiZGVhZGxpbmUiOjE1Mjc2Njk1MDB9'

// 通过七牛hash 换取 七牛imgurl
// type :   "lsp" -- 承运商  "driver" --  司机 "carrier"  -- 牵引车  "trailer" -- 挂车
export function getImgUrl(params) {
  return normalService({
    url: '/upload/getUrl',
    method: 'get',
    params
  })
}

// update司机信息附件信息存储
export function updateDriverAttach(data) {
  return normalService({
    url: '/driver/updateDriverAttach',
    method: 'post',
    data
  })
}

// update司机-运单-(发车确认、异常事故)附件信息存储
export function updateShipmentAttach(data) {
  return tmsService({
    url: '/shipmentAttach/photo',
    method: 'post',
    data
  })
}
